package com.haixiaoke.saas.order.mapper;

import com.haixiaoke.saas.order.domain.OrderRefundDetails;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单退款详情Mapper接口
 *
 * @author panda
 * @date 2024-04-19
 */
public interface OrderRefundDetailsMapper {
    /**
     * 查询订单退款详情
     *
     * @param id 订单退款详情主键
     * @return 订单退款详情
     */
    OrderRefundDetails selectOrderRefundDetailsById(Long id);

    /**
     * 查询订单退款详情列表
     *
     * @param orderRefundDetails 订单退款详情
     * @return 订单退款详情集合
     */
    List<OrderRefundDetails> selectOrderRefundDetailsList(OrderRefundDetails orderRefundDetails);

    /**
     * 新增订单退款详情
     *
     * @param orderRefundDetails 订单退款详情
     * @return 结果
     */
    int insertOrderRefundDetails(OrderRefundDetails orderRefundDetails);

    /**
     * 修改订单退款详情
     *
     * @param orderRefundDetails 订单退款详情
     * @return 结果
     */
    int updateOrderRefundDetails(OrderRefundDetails orderRefundDetails);

    /**
     * 删除订单退款详情
     *
     * @param id 订单退款详情主键
     * @return 结果
     */
    int deleteOrderRefundDetailsById(Long id);

    /**
     * 批量删除订单退款详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteOrderRefundDetailsByIds(Long[] ids);

    /**
     * 批量插入订单退款详情信息
     * @param orderRefundDetailsList
     * @return
     */
    int insertBatchOrderRefundDetails(List<OrderRefundDetails> orderRefundDetailsList);

    /**
     * 根据订单id查询退房每日收费详细信息
     * @param orderId
     * @return
     */
    List<OrderRefundDetails> selectOrderRefundDetailsByOrderId(String orderId);

    /**
     * 批量修改订单退款详情
     * @param refundDetailsList
     * @return
     */
    int updateBatchOrderRefundDetails(List<OrderRefundDetails> refundDetailsList);

    List<OrderRefundDetails> selectRefundDetailsByOrderIdOrLinkedOrderId(String orderId);

    /**
     * 统计退款金额,按退款类型统计
     * @param orderId
     * @return
     */
    List<OrderRefundDetails> countRefundPriceByRefundType(String orderId);

    List<OrderRefundDetails> selectOrderRefundDetailsByOrderIdAndRecordId(@Param("orderId") String orderId, @Param("recordId") Long recordId);

    int deleteOrderRefundDetailsByOrderId(String orderId);

    List<OrderRefundDetails> selectRefundDetailsByOrderIdOrLinkedOrderIdAndRefundType(@Param("orderId") String orderId, @Param("refundType") String refundType);
}
